import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        double n = num.nextDouble();
        int a = (int)n % 10;
        System.out.println(a);
    }
}
